package net.lab1024.sa.admin.module.system.user.domain.form;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import net.lab1024.sa.base.common.json.deserializer.FileKeyVoDeserializer;
import net.lab1024.sa.base.common.json.serializer.FileKeyVoSerializer;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

@Data
public class UserAddForm {

        @Schema(description = "用户编号")
        @NotBlank(message = "用户编号不能为空")
        private String userId;
        @Schema(description = "用户名称")
//        @NotNull(message = "用户名称编号不能为空")
        private String name;
        @Schema(description = "昵称")
        private String petName;
        @Schema(description = "性别")
        private Long gender;
        @Schema(description = "学校编号")
        private Long schoolId;
        @Schema(description = "专业编号")
        private Long majorId;
        @Schema(description = "学号")
        private Long idCard;
        @Schema(description = "联系电话")
        @Size(max = 11, message = "联系电话长度不能超过11位")
        private String phone;
        @Schema(description = "用户头像")
        @JsonSerialize(using = FileKeyVoSerializer.class)
        @JsonDeserialize(using = FileKeyVoDeserializer.class)
        private String picture;
        @Schema(description = "用户类型")
        private Long userType;

}